package com.hailian.fintech.hlfinanceserver.web;


import com.github.pagehelper.PageInfo;
import com.hailian.fintech.hlcomm_interfaceserver.entity.POJO;
import com.hailian.fintech.hlcomm_interfaceserver.result.ResultInfo;
import com.hailian.fintech.hlfinanceserver.entity.Jiaoyi;
import com.hailian.fintech.hlfinanceserver.service.IJiaoyiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.parameters.P;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wk
 * @since 2020-05-23
 */
@RestController
@RequestMapping("/jiaoyi")
public class JiaoyiController {

    @Autowired
    private IJiaoyiService iJiaoyiService;
    @RequestMapping("addJiaoyi")
    public Object addJioayi(@RequestBody Jiaoyi jiaoyi){
        jiaoyi.setResult("成功");
        jiaoyi.setPaytype_id(4);
        boolean flag = iJiaoyiService.saveOrUpdate(jiaoyi);
        return new ResultInfo().success(flag);
    }
    @RequestMapping("list")
    public Object list(@RequestParam(defaultValue = "1")Integer pageNum, @RequestParam(defaultValue = "3")Integer pageSize, POJO pojo){
        PageInfo info = iJiaoyiService.selectOwner(pageNum,pageSize,pojo);
        return new ResultInfo().success(info);
    }
}

